/**
* AutoSWF - Cody Cushing. March 26, 2009
* Copyright (c) 2009 Cody Cushing
* No use restrictions. Maintain this notice in all versions. 
**/

package com.autoswf.locator
{
	/**
	 * An object used to register a resource with a locator by bubbling up tiers.
	 */	
	public class ResourceRegistration
	{
		protected var _resource:Object;
		protected var _registeredClass:Class;
		protected var _persistent:Boolean;
		
		
		/**
		 * Constructor. 
		 * 
		 * @param resource  The resource instance
		 * @param registeredTo  The class definition or interface to register this resource to.
		 * @param persistent  To register the resource with a strong key so it doesn't get garbage collected.
		 */
		public function ResourceRegistration(resource:Object, registeredTo:Class, persistent:Boolean = false)
		{
			_resource = resource;
			_registeredClass = registeredTo;
			_persistent = persistent;
		}
		
		
		/**
		 * The resource instance to add to the Locator's dictionary.
		 */
		public function get resource():Object
		{
			return _resource;
		}
		
		
		/**
		 * The class definition or interface to register this resource to.
		 */
		public function get registeredClass():Class
		{
			return _registeredClass;
		}
		

		/**
		 * To register the resource with a strong key so it doesn't get garbage collected.
		 */		
		public function get persistent():Boolean
		{
			return _persistent;
		}

	}
}